package system.log;

import java.io.Serializable;
import java.util.Date;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import system.general.Columna;
import system.general.Table;

/**
 *
 * @author gilberto
 */
@ManagedBean(name = "system_logBeans")
@ViewScoped
@Table(nombre = "bitacora")
public class Beans implements Serializable {

    @Columna(nombre = "id", isNoNulo = true, tipo = "Integer", tamano = 10, digitosDecimales = 0, comentario = "", is_autoincrementable = "SI", isPK = true, isImagen = false, isUrl = false, isVisible = true)
    private Integer id = 0;
    @Columna(nombre = "persona", isNoNulo = false, tipo = "String", tamano = 200, digitosDecimales = 0, comentario = "", is_autoincrementable = "NO", isPK = false, isImagen = false, isUrl = false, isVisible = true)
    private String persona = "";
    @Columna(nombre = "sql", isNoNulo = false, tipo = "String", tamano = 2147483647, digitosDecimales = 0, comentario = "", is_autoincrementable = "NO", isPK = false, isImagen = false, isUrl = false, isVisible = true)
    private String sql = "";
    @Columna(nombre = "fecha", isNoNulo = false, tipo = "Date", tamano = 29, digitosDecimales = 6, comentario = "", is_autoincrementable = "NO", isPK = false, isImagen = false, isUrl = false, isVisible = true)
    private Date fecha = new java.util.Date();

    public Beans() {
    }

    public Beans(Integer id, String persona, String accion, Date fecha) {
        this.id = id;
        this.persona = persona;
        this.sql = accion;
        this.fecha = fecha;
    }

    public void clearBeans() {
        setId(0);
        setPersona("");
        setSql("");
        setFecha(new java.util.Date());
    }

    private String strScape(String data) {
        data = data.trim();
        data = data.replace("'", "\'");
        data = data.replace("\\", "\\\\");
        return data;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return this.id;
    }

    public void setPersona(String persona) {
        this.persona = persona;
    }

    public String getPersona() {
        return this.persona;
    }

    public void setSql(String sql) {
        this.sql = sql;
    }

    public String getSql() {
        return this.sql;
    }

    public void setFecha(Date fecha) {
        this.fecha = fecha;
    }

    public Date getFecha() {
        return this.fecha;
    }
}
